package com.iot.common.security.feign.factory;

import com.iot.common.security.feign.SecurityOauthService;
import com.iot.common.security.feign.fallback.SecurityOauthServiceFallbackImpl;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class SecurityServiceFallbackFactory implements FallbackFactory<SecurityOauthService> {

	@Override
	public SecurityOauthService create(Throwable throwable) {
		SecurityOauthServiceFallbackImpl securityOauthServiceFallbackImpl = new SecurityOauthServiceFallbackImpl();
		securityOauthServiceFallbackImpl.setCause(throwable);
		return securityOauthServiceFallbackImpl;
	}

}
